package com.xueyi.workflow.controller;

import com.xueyi.common.web.entity.controller.BaseController;
import com.xueyi.workflow.domain.query.FormDataQuery;
import com.xueyi.workflow.domain.dto.FormDataDto;
import com.xueyi.workflow.service.FormDataService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import com.xueyi.common.core.web.result.AjaxResult;
import java.util.List;

@Tag(name = "流程表单数据管理")
@RestController
@RequestMapping("/formData")
public class FormDataController extends BaseController<FormDataQuery, FormDataDto, FormDataService> {
    @Autowired
    private FormDataService baseService;

    @Override
    protected String getNodeName() {
        return "流程表单数据";
    }

    @GetMapping("/byInstance/{instanceId}")
    public AjaxResult getByInstanceId(@PathVariable String instanceId) {
        FormDataQuery query = new FormDataQuery();
        query.setProcessInstanceId(instanceId);
        List<FormDataDto> list = baseService.selectList(query);
        return AjaxResult.success(list);
    }
} 